{include file="./layout/header.html" /}
<body>
<div class="x-body" >
    <form class="layui-form" id="intr">

        <div class="layui-form-item">
            <div class="layui-input-inline">
                <input   type="hidden" id="sid" name="sid" required="" lay-verify="required"
                         autocomplete="off" class="layui-input" placeholder="" value='{$sid}'>
            </div>
        </div>

        <div class="layui-form-item">
            <label for="number" class="layui-form-label">
                <span class="x-red">*</span>论文编号
            </label>
            <div class="layui-input-inline">
                <input   type="text" id="number" name="number" required="" lay-verify="required"
                         autocomplete="off" class="layui-input" placeholder="" value='{$time}'>
            </div>
        </div>

        <div class="layui-form-item">
            <label for="presentation_preference" class="layui-form-label">
                <span class="x-red">*</span>论文报告方式
            </label>
            <div class="layui-input-inline">
                <input   type="text" id="presentation_preference" name="presentation_preference" required="" lay-verify="required"
                         autocomplete="off" class="layui-input" placeholder="" value="POSTER">
            </div>
        </div>

        <div class="layui-form-item">
            <label for="" class="layui-form-label">
                <span class="x-red">*</span>摘要资料
            </label>
            <div class="layui-input-inline">
                <!--<button class="layui-btn" id="files" name="files" type="button"><i class="layui-icon"></i>上传文件</button>-->
                <input   type="text" id="abstract" name="abstract[file_url]" required="" lay-verify="required"
                         autocomplete="off" class="layui-input" placeholder="" value="/abstract/123.doc">
            </div>
        </div>


        <div class="layui-form-item">
            <label for="authors['email']" class="layui-form-label">
                <span class="x-red">*</span>作者email
            </label>
            <div class="layui-input-inline">
                <!--<button class="layui-btn" id="files" name="files" type="button"><i class="layui-icon"></i>上传文件</button>-->
                <input   type="text" id="authors['email']" name="authors[email]" required="" lay-verify="required"
                         autocomplete="off" class="layui-input" placeholder="" value="">
            </div>
        </div>


        <div class="layui-form-item">
            <label for="authors['first_name']" class="layui-form-label">
                <span class="x-red">*</span>姓
            </label>
            <div class="layui-input-inline">
                <!--<button class="layui-btn" id="files" name="files" type="button"><i class="layui-icon"></i>上传文件</button>-->
                <input   type="text" id="authors['first_name']" name="authors[first_name]" required="" lay-verify="required"
                         autocomplete="off" class="layui-input" placeholder="" value="">
            </div>
        </div>

        <div class="layui-form-item">
            <label for="authors['middle_name']" class="layui-form-label">
                <span class="x-red">*</span>中间名
            </label>
            <div class="layui-input-inline">
                <!--<button class="layui-btn" id="files" name="files" type="button"><i class="layui-icon"></i>上传文件</button>-->
                <input   type="text" id="authors['middle_name']" name="authors[middle_name]" required="" lay-verify="required"
                         autocomplete="off" class="layui-input" placeholder="" value="">
            </div>
        </div>

        <div class="layui-form-item">
            <label for="" class="layui-form-label">
                <span class="x-red">*</span>名
            </label>
            <div class="layui-input-inline">
                <!--<button class="layui-btn" id="files" name="files" type="button"><i class="layui-icon"></i>上传文件</button>-->
                <input   type="text" id="abstract['last_name']" name="authors[last_name]" required="" lay-verify="required"
                         autocomplete="off" class="layui-input" placeholder="" value="">
            </div>
        </div>

        <!--<div class="layui-form-item">-->
            <!--<label for="authors['title']" class="layui-form-label">-->
                <!--<span class="x-red">*</span>标题-->
            <!--</label>-->
            <!--<div class="layui-input-inline">-->
                <!--&lt;!&ndash;<button class="layui-btn" id="files" name="files" type="button"><i class="layui-icon"></i>上传文件</button>&ndash;&gt;-->
                <!--<input   type="text" id="authors['title']" name="authors[title]" required="" lay-verify="required"-->
                         <!--autocomplete="off" class="layui-input" placeholder="" value="">-->
            <!--</div>-->
        <!--</div>-->

        <div class="layui-form-item">
            <label class="layui-form-label">标题</label>
            <div class="layui-input-block">
                <select name="authors[title]" lay-verify="required">
                    <option value=""></option>
                    <option value="DR">博士</option>
                    <option value="MR">先生</option>
                    <option value="MRS">夫人</option>
                    <option value="MS">女士</option>
                    <option value="PROF">教授</option>
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">国家</label>
            <div class="layui-input-block">
                <select name="authors[country]" lay-verify="required">
                    <option value=""></option>
                    <option value="AL">阿尔巴尼亚</option>
                    <option value="DZ">阿尔及利亚</option>
                    <option value="AF">阿富汗</option>
                    <option value="AR">阿根廷</option>
                    <option value="AE">阿拉伯联合酋长国</option>
                </select>
            </div>
        </div>

        {foreach $lang.hy as $vo}
        <div class="layui-form-item">
            <label for="['{$vo.lan}']['title']" class="layui-form-label">
                <span class="x-red">*</span>{$vo.title}
            </label>
            <div class="layui-input-inline">
                <input   type="text" id="['{$vo.lan}']['title']" name="translations[{$vo.lan}][title]" required="" lay-verify="required"
                         autocomplete="off" class="layui-input" placeholder="">
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label for="['{$vo.lan}']['content']" class="layui-form-label">
                <span class="x-red">*</span>{$vo.content}
            </label>
            <div class="layui-input-block">
                <textarea style="padding:0px" placeholder="请输入内容" id="['{$vo.lan}']['content']" name="translations[{$vo.lan}][remark]" class="layui-textarea"></textarea>
            </div>
        </div>
        {if condition="$vo.lan eq 'en'"}
        <!-- 实例化编辑器 -->
        <script type="text/javascript">
            var ue = UE.getEditor("['en']['content']");
        </script>
        {else/}
        <script type="text/javascript">
            var ue = UE.getEditor("['zh-CN']['content']");
        </script>
        {/if}
        {/foreach}



        <div class="layui-form-item">
            <label  class="layui-form-label">
            </label>
            <button  class="layui-btn" lay-filter="add" lay-submit="">
                增加
            </button>
        </div>
    </form>
</div>

<!-- 加载编辑器的容器 -->
<script id="container" name="content" type="text/plain">
        这里写你的初始化内容
    </script>
<!-- 引入百度编辑器 -->
<script type="text/javascript" src="__CDN__/lib/ueditor/ueditor.config.js" charset="utf-8"></script>
<script type="text/javascript" src="__CDN__/lib/ueditor/ueditor.all.js" charset="utf-8"></script>
<!-- 实例化编辑器 -->
<script type="text/javascript">
    var ue = UE.getEditor('desc');
    var ue = UE.getEditor("['zh-CN']['content']");
    var ue = UE.getEditor("['en']['content']");
</script>
<script>
    layui.use(['form','layer'], function(){
        $ = layui.jquery;
        var form = layui.form
            ,layer = layui.layer;

        //监听提交
        form.on('submit(add)', function(data){
            // var str = new Array(); //定义一数组
            // str = uri$('#intr').serialize();
            var formData = $("#intr").serialize();

            //发异步，把数据提交给php
            $.ajax({
                dataType : 'json',
                type : 'POST',
                url : "{:url('Conferpaper/add')}",
                async: false,
                data : formData,
                success : function(msg){
                    layer.alert(msg.msg, {icon: 6},function () {
                        window.parent.location.reload();
                        var index = parent.layer.getFrameIndex(window.name);
                        parent.layer.close(index);
                    });
                },
                error : function(XMLHttpRequest, textStatus, errorThrown) {
                    alert(XMLHttpRequest.status + "," + textStatus);
                }
            });

            return false;
        });


    });

    layui.use('upload', function(){
        var upload = layui.upload;

        //执行实例
        var uploadInst = upload.render({
            elem: '#files'
            ,url: '{:url("Common/upload")}' //上传接口
            ,accept: 'file' //普通文件
            ,done: function(res) {
                console.log(res);
                }
            ,error: function(){
                //请求异常回调
            }
        });
    });


</script>
{include file="./layout/footer.html" /}